Skip to content

Updating to d3-sankey 0.7.1 #3355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed

Updating to d3-sankey 0.7.1 #3355

wants to merge 8 commits into from

Conversation

antoinerg
Copy link
Contributor

This will be the starting point to migrate to https://github.com/tomshanley/d3-sankey-circular which closely ressembles d3-sankey v0.7.1 API.

The biggest difference with the previous version of d3-sankey is a change of coordinate (x, dx) -> (x0, x1).

This is still a WIP although all tests are passing and only one baseline had to be slightly updated.

"alpha-shape": "^1.0.0",
"array-range": "^1.0.1",
"canvas-fit": "^1.5.0",
"color-normalize": "^1.3.0",
"convex-hull": "^1.0.3",
"country-regex": "^1.1.0",
"d3": "^3.5.12",
"d3-sankey": "git://github.com/antoinerg/d3-sankey.git#4f37ed8d3578b545a8569ecd74583f373768e900",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link above give me zero diff!
Thought the link one the line below may be the correct one?
d3/d3-sankey@master...antoinerg:fix-large-padding

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you @archmoj! The only changes I made are are in src/sankey.js.

@@ -218,22 +107,50 @@ function linkModel(uniqueKeys, d, l) {
};
}

function nodeModel(uniqueKeys, d, n) {
function linkPath() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path generator for links used to lived in our fork of d3-sankey and was added in this commit:
plotly/d3-sankey@80c33c3 . It doesn't need to live in there and could be moved back in here.

This and the fix for large node padding are the only improvements that we had over d3-sankey v0.4.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To substantiate this last comment, you can review the changes of our forked d3-sankey has compared to v0.4.2.

var removedNodes = false;
var nodeIndices = {};

for(i = 0; i < nodeCount; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking comment: when deleting from a list one may consider reversing the loop count and simply drop (pop) items from the array.

@archmoj
Copy link
Contributor

archmoj commented Dec 20, 2018

@antoinerg Great work! I was wondering if the status of this PR should be changed to review-able?

@antoinerg
Copy link
Contributor Author

antoinerg commented Dec 21, 2018

Thanks @archmoj! This is by no means urgent and I feel like it might be a bit too early for a review. There is still the possibility that we get rid of d3-sankey altogether if it doesn't fit our requirements. I'll give you an update about this soon.

@etpinard
Copy link
Contributor

@antoinerg Looks like all the commits here are now part of #3406

Ok if we close this one?

@antoinerg
Copy link
Contributor Author

@antoinerg Looks like all the commits here are now part of #3406

Ok if we close this one?

Yes, it's all part of #3406 and I should have closed this one. Sorry about that!

@antoinerg antoinerg closed this Jan 15, 2019
@antoinerg antoinerg deleted the sankey-d3-sankey-0.7 branch January 23, 2019 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants